<script lang="ts" setup>
const props = defineProps({
    label: {
        type: String,
        default: '标题',
    },
    value: {
        type: [String, Number],
        default: '内容',
    },
    link: {
        type: Boolean,
        default: false,
    },
    border: {
        type: Boolean,
        default: true,
    },
})

const emits = defineEmits(['click'])

function onClick() {
    emits('click')
}
</script>

<template>
    <view class="cell-item box-border flex items-center justify-between py-34rpx" :class="{ 'border-b-1 border-b-solid border-b-#f4f4f7': border }" @click="onClick">
        <view>
            <slot name="label">
                <view class="text-lg">{{ label }}</view>
            </slot>
        </view>
        <view>
            <slot name="right">
                <view class="flex">
                    <slot name="value">
                        <view class="text-gray">{{ value }}</view>
                    </slot>
                    <img v-if="link" class="ml-16rpx h-36rpx w-36rpx" src="../static/images/icon-right.png" alt="">
                </view>
            </slot>
        </view>
    </view>
</template>
